package com.boot.netty.client;

import com.boot.netty.client.listener.NettyClient;
import com.boot.netty.commons.entity.UserInfo;
import com.boot.netty.commons.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@Slf4j
@ComponentScan(basePackages = {"com.boot.netty.*"})
@SpringBootApplication
public class NettyClientApplication implements CommandLineRunner {

    @Autowired
    private NettyClient nettyClient;


    public static void main(String[] args) {
        SpringApplication.run(NettyClientApplication.class, args);
    }


    @Override
    public void run(String... args) throws Exception {
        log.info("正在启动netty客户端");
        nettyClient.connectServer();
    }
}
